package com.wn.service;

import com.wn.service.controller.WorkProduct6;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @author yellow Docter
 * @date 2022 -08-31
 * @desc  测试死信队列中的消息消费
 */
@SpringBootTest
public class RabbitMqTest05 {

    @Autowired
    private WorkProduct6 workProduct6;

    @Test
    public void demo03(){

        long begin = System.currentTimeMillis();
        for (int i = 0; i < 100000; i++) {
            workProduct6.sendMsg(
                    "exchange-normal",
                    "zhangsan",
                    "中奖了3000W" + i
            );
        }
        long end = System.currentTimeMillis();

        System.out.println(end - begin);
    }
}
